// pages/demo/demo.ts
type TabItem = {
  icon: string;
  activeIcon: string;
  title: string;
}

Page({
  data: {
    // Tab栏配置 ‌:ml-citation{ref="3,4" data="citationList"}
    tabs: [
      {
        icon: "https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/jinenggongvle.webp",
        activeIcon: "https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/jinenggongvle.webp",
        title: "大秘境"
      },
      {
        icon: "https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/diaoluo.webp",
        activeIcon: "https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/diaoluo.webp",
        title: "团本"
      },
      // {
      //   icon: "https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/cizhui.webp",
      //   activeIcon: "https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/cizhui.webp",
      //   title: "词缀"
      // }
    ] as TabItem[],
    currentTabIndex: 0,
    
    // 列表数据
    listData: [
      {
        id: 1, 
        content: "暗焰裂口",
        image:"https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/11_1/nuyanliekou.webp",
        mysticFlag:1,
        raidFlag:0
      },
      {
        id: 2, 
        content: "燧酿酒庄",
        image:"https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/11_1/suiniangjiuzhuang.webp",
        mysticFlag:1,
        raidFlag:0
      },
      {
        id: 3, 
        content: "圣焰隐修院",
        image:"https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/11_1/shengyanyinxiuyuan.webp",
        mysticFlag:1,
        raidFlag:0
      },
      {
        id: 4, 
        content: "驭雷栖巢",
        image:"https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/11_1/yuleiqichao.webp",
        mysticFlag:1,
        raidFlag:0
      },
      {
        id: 5, 
        content: "麦卡贡行动 - 车间",
        image:"https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/11_1/maikagongchejian.webp",    mysticFlag:1,
        raidFlag:0
      },
      {
        id: 6, 
        content: "暴富矿区！！",
        image:"https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/11_1/baofukuangqu.webp",
        mysticFlag:1,
        raidFlag:0
      },
      {
        id: 7, 
        content: "水闸行动",
        image:"https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/11_1/shuizhaxingdong.webp",    mysticFlag:1,
        raidFlag:0
      },
      {
        id: 8, 
        content: "伤势剧场",
        image:"https://wow.shuzhipeixian.com:12812/download/wow_collect/mystic/sys/11_1/shangshijuchang.webp",
        mysticFlag:1,
        raidFlag:0
      },
    ] as GameInstance[]
  },

  // Tab切换处理 ‌:ml-citation{ref="1,2" data="citationList"}
  handleTabTap(e: WechatMiniprogram.TapEvent) {
    const index = e.currentTarget.dataset.index;
    this.setData({ currentTabIndex: index });
    // 这里可添加对应tab的数据加载逻辑
  },
  pageJump(e:any){
      console.log(e.currentTarget.dataset.id)
      wx.navigateTo({
        url:"/pages/game_instance/mystic-guid/index?id="+e.currentTarget.dataset.id
      })
  }
})
